package com.yh.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @Auther: als
 * @Date: 2024/5/28 - 05 - 28 - 11:32
 * @Description: com.yh.dao
 * @version: 1.0
 */
public interface UsersRoleDao {

    @Insert("insert into users_role (userId,roleId) values(#{userId},#{roleId})")
    int insertUR(@Param("userId") int userId, @Param("roleId")  int roleId);


    @Delete("delete from users_role where userId=#{uid}")
    int deleteByUid(int uid);

    //修改用户
    @Update("update users_role set roleId=#{roleId} where userId=#{userId}")
    int UpdateRoleIdByUsersId(@Param("userId") int userId,@Param("roleId")  int roleId);
}
